using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Text;

using Peradigm.Framework.Domain.Security;
using Peradigm.Framework.Persistence;

namespace Liberty.Domain.ApprovalManagement
{
    [Serializable]
    public class Activity  : ReferenceValue
    {
        #region Constants
        public const string
            ACTIVITY_APPROVAL = "Approval",
            ACTIVITY_CREATION = "Creation",
            ACTIVITY_DISPERSAL = "Dispersal",
            ACTIVITY_VERIFICATION = "Verification";
        #endregion

        #region Event Handlers
        #endregion

        #region Methods
        /// <summary>
        /// Creates a stubbed activity populated with frequently used primitives.  
        /// Other aggregated objects are not populated by this factory method.
        /// </summary>
        /// <returns></returns>
        public static Activity TestInstance()
        {
            Activity stub = new Activity( 12L, PersistentModel.NEW_VERSION, "An Activity", 3, true );          

            return stub;
        }

        /// <summary>
        /// Two activities are equal if either their unique identifiers are identical, or
        /// their descriptions match exactly (case sensitive).
        /// </summary>
        /// <param name="testActivity"></param>
        /// <returns>Whether or not the two activities are equal</returns>
        public override bool Equals( ReferenceValue aReferenceValue )
        {
            if( aReferenceValue.GetType() != this.GetType() )
                return false;

            Activity testActivity = aReferenceValue as Activity;
            if( ( this.Oid == PersistentModel.NEW_OID ) || ( testActivity.Oid == PersistentModel.NEW_OID ) )
            {
                return ( this.Description == testActivity.Description );
            }

            return ( this.Oid == testActivity.Oid );
        }
        #endregion

        #region Properties
        #endregion

        #region Private Methods
        #endregion

        #region Private Properties
        #endregion

        #region Construction and Finalization
        public Activity( string description, long ranking, bool active )
            : base( description, ranking, active )
        {
        }

        public Activity( long oid, byte[] rowLock, string description, long ranking, bool active )
            : base( oid, rowLock, description, ranking, active )
        {
        }
        #endregion

        #region Data Elements
        #endregion

    } 
} 